import java.util.Scanner;
import java.util.InputMismatchException;
public class Lab03Task05 {

	public static void main(String[] args) {
	double x,r,s,d;
	try {
		Scanner kb=new Scanner(System.in);
		System.out.println("Enter base salary [SAR]");
		x=kb.nextDouble();
		System.out.println("Enter actual number of years of service :");
		r=kb.nextDouble();
		s=x*r;
		d=(x*(int)r);
		System.out.printf("Retirement benefit1 = %.2f Saudi Riyals%n",s);
		System.out.printf("Retirement benefit2 = %.2f Saudi Riyals",d);
	    }
	catch (InputMismatchException e)
	{
		System.out.println("Error: Invalid input");	
	}

	}

}